Skip to content

Vectorize pandas.Series.apply #355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed

Vectorize pandas.Series.apply #355

wants to merge 5 commits into from

Conversation

aman-thakral
Copy link
Contributor

When profiling my code I noticed that numpy.vectorize was a bit faster than pandas.Series.apply.

Execution Times:
numpy.vectorize: 3.3 seconds
pandas.Series.apply: 4.4 seconds.

@wesm
Copy link
Member

wesm commented Nov 10, 2011

hey, be careful to add features in branches and not the master branch :) I will take a look at the apply patch, looks like a no brainer. You may consider resetting your fork to be exactly wesm/master since you've got a couple of merge commits

@aman-thakral
Copy link
Contributor Author

Definitely a good idea for me to reset my fork. Also, I guess the same reasoning could apply to Series.map. Unless you have some use case distinctions for map and apply in mind (besides map also accepting a dict). It would be good to document this distinction as well :).

@wesm
Copy link
Member

wesm commented Nov 11, 2011

np.vectorize has some string handling problems (changing Series.map and apply to vectorize caused unit test failures). I'll patch this separately very quickly (maybe writing a Cython function) and make sure the speed is comparable

@wesm
Copy link
Member

wesm commented Nov 11, 2011

see above commit...added a new cython function that's about 25% faster than np.vectorize and gets the types right. thanks for pointing this out!

@wesm wesm closed this Nov 11, 2011
dan-nadler pushed a commit to dan-nadler/pandas that referenced this pull request Sep 23, 2019
* Update .travis.yml

* Update setup.py
dan-nadler pushed a commit to dan-nadler/pandas that referenced this pull request Sep 23, 2019
* Revert "Update CHANGES.md"

This reverts commit b26bdcc.

* Revert "Revert lz4 pinning (pandas-dev#355)"

This reverts commit 4308fe7.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants